package com;

import java.util.Scanner;

public class LuckyGuess {
	public static void main(String[] args) {
		int counter = 0;
		int a;
		int num = (int) (Math.random() * 100);
		
		do {
			Scanner in = new Scanner(System.in);
			System.out.print("请输入你猜测的数字：");
			a = in.nextInt();

			if (a == num) {
				System.out.println("恭喜你！你猜对了！");
				counter++;
				
				switch (counter) {
				case 1:
					System.out.println("你太有才了！");
					break;
				case 2:
				case 4:
				case 5:
				case 6:
					System.out.println("这么快就猜出来了，很聪明么！");
					break;
				default:
					System.out.println("猜了半天才猜出来，小同志，尚需努力啊！");
					break;
				}
				
				break;
			} else {
				if (a > num) {
					System.out.println("你猜的数字太大了！");
					counter++;
				} else if (a < num) {
					System.out.println("你猜的数字太小了！");
					counter++;
				}
			}
			
			System.out.println();
			
		} while (counter < 10);
		
		if (counter == 10)
			System.out.println("你输了！小同志，要加油啊！");
		else
			System.out.println("你共猜了" + counter + "次。");
	}
}
